package com.hundsun.yr.universal.p2p.bean;

import android.text.TextUtils;

/**
 * @Title: Transfer.java 
 * @Description: 转让
 * @date 2016-1-26 下午7:48:42 
 * @author:hejun.shen
 * @email:shenhj15971@hundsun.com 
 * @replace author:
 * @replace date:
 * @version V1.0   
 */
public class Transfer {
	
	/**
	 * 取值的key
	 */
	public static String BASEKEY="transferGoodsPojos";

	/**
	 * 年化收益率
	 */
	public static String ANULINCMRATE = "anulIncmRate";
	/**
	 * 折扣率
	 */
	public static String DEPOSITRATE = "depositRate";
	/**
	 * 公允价格
	 */
	public static String FAIRPRICE = "fairPrice";
	/**
	 * 商品ID
	 */
	public static String GDSID = "gdsId";
	/**
	 * 营销商品ID
	 */
	public static String MKTGDSID = "mktGdsId";
	/**
	 * 营销商品名称
	 */
	public static String MKTGDSNAME = "mktGdsName";
	/**
	 * 收益方式
	 */
	public static String INCOMEMODE = "incomeMode";
	/**
	 * 转让份额
	 */
	public static String TRANSFERSHARE = "transferShare";
	/**
	 * 剩余份额
	 */
	public static String RESIDUALSHARE = "residualShare";
	/**
	 * 剩余期限
	 */
	public static String RESIDUALTERM = "residualTerm";
	/**
	 * 转让日期
	 */
	public static String TRANSFERDATE = "transferDate";
	/**
	 * 转让商品单编号
	 */
	public static String TRANSFERGOODSNO = "transferGoodsNo";
	/**
	 * 转让价格 
	 */
	public static String TRANSFERPRICE = "transferPrice";
	/**
	 * 转让状态(TFR("1", "转让中"), TFRSCSS("2", "售完"), TFRCNCL("3", "部分撤销"), TFRFAIL("4", "已撤销"))
	 */
	public static String TRANSFERSTATE = "transferState";
	/**
	 * 起售份额
	 */
	public static String STARTSHARE = "startShare";
	/**
	 * 递增份额
	 */
	public static String INCREASESHARE = "increaseShare";
	/**
	 * 协议编号 
	 */
	public static String PROTOCOLNO = "protocolNo";
	/**
	 * 保障方式
	 */
	public static String GTDMODE = "gtdMode";
	/**
	 * 保障方式 ID信息
	 */
	public static String GTDMODE_KEY = "key";
	/**
	 * 保障方式值信息
	 */
	public static String GTDMODE_VALUE = "value";
	/**
	 * 投资期限
	 */
	public static String IVSMTMLMT = "ivsmTmLmt";
	/**
	 * 投资期限类型
	 */
	public static String IVSMTMLMTTYPE = "ivsmTmLmtType";
	/**
	 * 商品成立时间
	 */
	public static String ESTABLISHTIME = "establishTime";
	
	
	/**
	 * 保障方式
	 * @param key
	 * @return
	 */
	public static String getgtdMode(String key) {
		String value="本息保障";
		
		if(TextUtils.equals(key, "1")){
			value="本息保障";
		}else if(TextUtils.equals(key, "2")){
			value="本金保障";
		}
		
		return value;
	}
	
	
	/**
	 * 获取转让状态
	 * @param state 取转让状态
	 * @return String
	 */
	public static String transferState(String state) {
		String trf_state="转让中";
		if(TextUtils.equals(state, "TFR")){//转让中
			trf_state="转让中";
		}else if(TextUtils.equals(state, "TFRSCSS")){//售完
			trf_state="售完";
		}else if(TextUtils.equals(state, "TFRCNCL")){//部分撤销
			trf_state="部分撤销";
		}else if(TextUtils.equals(state, "TFRFAIL")){//已撤销
			trf_state="已撤销";
		}
		
		return trf_state;
	}
	
	/**
	 * 获取限单位
	 * 
	 * @param mlmttype 期限类型
	 * @return String
	 */
	public static String getLimttype(String mlmttype) {

		String limttype = "天";

		if (TextUtils.equals(mlmttype, "DAY")) {
			limttype = "天";
		} else if (TextUtils.equals(mlmttype, "MONTH")) {
			limttype = "月";
		}

		return limttype;
	}
}
